package com.xjoyt.pay.master.interfaces;

import java.util.List;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.master.params.CompanyPageParam;
import com.xjoyt.pay.master.po.Company;

public interface CompanyContract {

	@RequestMapping("get/{id}")
	Company get(@PathVariable("id") String id);

	@RequestMapping(value = "save", method = RequestMethod.POST)
	ExecuteResult<Company> save(Company param);

	@RequestMapping("remove/{id}")
	ExecuteResult<?> remove(@PathVariable("id") String id);

	@RequestMapping(value = "removeAll", method = RequestMethod.POST)
	ExecuteResult<?> removeAll(List<String> ids);

	@RequestMapping(value = "loadPage", method = RequestMethod.POST)
	PageResult<Company> loadPage(PageParam<CompanyPageParam> param);

	/**
	 * 取下级
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping("findAllById/{id}")
	List<Company> findAllById(@PathVariable("id") String id);

	@RequestMapping("findAllParentById")
	List<Company> findAllParentById(List<String> ids);

	@RequestMapping("getByDomain/{domain}")
	Company getByDomain(@PathVariable("domain") String domain);

}
